package com.qqtech.qquan.circle.model;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;
import com.qqtech.qquan.circle.enums.CircleBaseTypeDictEnum;
import com.qqtech.qquan.circle.enums.CircleConst;
import com.qqtech.qquan.circle.enums.CircleFuncTypeDictEnum;
import com.qqtech.qquan.circle.enums.CircleOpenLevelDictEnum;
import com.qqtech.qquan.user.enums.UserConst;

@SuppressWarnings("serial")
public class CircleBaseVo extends CircleBase {
	private boolean checked;
	
	
	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	/**城市名称**/
	private java.lang.String cityName;
	/**社区名称**/
	private java.lang.String communityName;
	/**社区名称-扩展的**/
	private java.lang.String extCommunityNames;
	/** 圈主名称 **/
	private java.lang.String creatorName;
	private java.lang.String creatorLogo;
	
	/**公开性-名称**/
	private java.lang.String openLevelName;
	/**是否显示-加入按钮**/
	private boolean canJion = false;
	/**是否显示-群聊按钮**/
	private boolean canChat = false;
	/**是否可以发布话题**/
	private boolean canAddTopic = false;
	/**是否可以签到**/
	private boolean canSign = false;
	/**是否可以发布投票**/
	private boolean canAddVote = false;
	/**是否可以发布活动**/
	private boolean canAddActivity = false;
	
	/**是否显示审核状态**/
	private boolean isShowAuditStatus = false;
	/**类型名称**/
	private java.lang.String typeName;
	
	private java.lang.Integer memberCount;
	private java.lang.Integer topicCount;
	private java.lang.Integer pv;
	/**排序**/
	private java.lang.Integer oidx;
	
	/**区域范围名称**/
	private java.lang.String zoneLevelName;

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public boolean getCanJion() {
		return canJion;
	}

	public void setCanJion(boolean canJion) {
		this.canJion = canJion;
	}

	public java.lang.String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(java.lang.String creatorName) {
		this.creatorName = creatorName;
	}

	/**
	 * 圈子LOGO全URL example: http://192.168.1.xxx:8080/circle/1.png
	 * 
	 * @return
	 */
	public java.lang.String getFullLogo() {
		if(StringUtil.isBlank(this.getLogo())){
			return "source://image/common/userLogin.png";
		}else if(this.getLogo().indexOf("source://")>-1){
			return this.getLogo();
		} else{
			return super.getImgHandleDomain()+""+this.getLogo()+""+CircleConst.LOGO_POSTFIX;
		}
	}
	
	public java.lang.String getBigFullLogo() {
		if(StringUtil.isBlank(this.getLogo())){
			return "source://image/common/userLogin.png";
		}else if(this.getLogo().indexOf("source://")>-1){
			return this.getLogo();
		} else{
			return super.getImgHandleDomain()+""+this.getLogo();
		}
	}

	public boolean getIsOfficial() {
		boolean isOfficial = false;
		if (CircleBaseTypeDictEnum.OFFICIAL.getCode() == getType()) {
			isOfficial = true;
		}
		return isOfficial;
	}
	
	/**
	 * 是否只是群聊
	 * @return
	 */
	public boolean isGroupChat() {
		boolean isGroupChat = false;
		if (CircleFuncTypeDictEnum.CHATONLY.getCode() == getFuncType()) {
			isGroupChat = true;
		}
		return isGroupChat;
	}

	/**
	 * 是否只能发布话题
	 * @return
	 */
	public boolean isTopicOnly() {
		boolean isTopicOnly = false;
		if (CircleFuncTypeDictEnum.TOPICONLY.getCode() == getFuncType()) {
			isTopicOnly = true;
		}
		return isTopicOnly;
	}
	
	public java.lang.Integer getMemberCount() {
		return memberCount;
	}
	
	public java.lang.String getMemberCountDesc() {
		if(this.getMemberCount() == null){
			return "";
		}
		if(this.getMemberCount() > 0){
			return this.getMemberCount()+"人";
		}else{
			return "";
		}
	}

	public void setMemberCount(java.lang.Integer memberCount) {
		this.memberCount = memberCount;
	}

	public java.lang.Integer getTopicCount() {
		return topicCount;
	}

	public void setTopicCount(java.lang.Integer topicCount) {
		this.topicCount = topicCount;
	}

	public java.lang.Integer getPv() {
		return pv;
	}

	public void setPv(java.lang.Integer pv) {
		this.pv = pv;
	}

	public boolean getCanAddTopic() {
		return canAddTopic;
	}

	public void setCanAddTopic(boolean canAddTopic) {
		this.canAddTopic = canAddTopic;
	}

	public boolean getCanChat() {
		return canChat;
	}

	public void setCanChat(boolean canChat) {
		this.canChat = canChat;
	}
	
	public java.lang.String getCreatorLogo() {
		return creatorLogo;
	}

	public void setCreatorLogo(java.lang.String creatorLogo) {
		this.creatorLogo = creatorLogo;
	}
	
	public java.lang.String getFullCreatorLogo() {
		if(StringUtil.isBlank(this.getCreatorLogo())){
			return "source://image/common/userLogin.png";
		}else if(this.getLogo().indexOf("source://")>-1){
			return this.getCreatorLogo();
		} else{
			return super.getImgHandleDomain()+""+this.getCreatorLogo()+""+UserConst.IMG_POSTFIX;
		}
	}
	
	/**
	 * 是否私密圈子
	 * @return
	 */
	public boolean isPrivate() {
		if(CircleOpenLevelDictEnum.PRIVATE.getCode()==super.getOpenLevel()){
			return true;
		}else{
			return false;
		}
	}

	public boolean isCanSign() {
		return canSign;
	}

	public void setCanSign(boolean canSign) {
		this.canSign = canSign;
	}

	public boolean isCanAddVote() {
		return canAddVote;
	}

	public void setCanAddVote(boolean canAddVote) {
		this.canAddVote = canAddVote;
	}

	public boolean isCanAddActivity() {
		return canAddActivity;
	}

	public void setCanAddActivity(boolean canAddActivity) {
		this.canAddActivity = canAddActivity;
	}

	public java.lang.String getOpenLevelName() {
		return openLevelName;
	}

	public void setOpenLevelName(java.lang.String openLevelName) {
		this.openLevelName = openLevelName;
	}

	public java.lang.String getTagNameStr() {
		if(StringUtil.isBlank(this.getTagName())){
			return "";
		}else{
			return this.getTagName();
		}
	}

	public boolean isShowAuditStatus() {
		return isShowAuditStatus;
	}

	public void setShowAuditStatus(boolean isShowAuditStatus) {
		this.isShowAuditStatus = isShowAuditStatus;
	}

	public java.lang.String getTypeName() {
		return typeName;
	}

	public void setTypeName(java.lang.String typeName) {
		this.typeName = typeName;
	}

	public java.lang.String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(java.lang.String communityName) {
		this.communityName = communityName;
	}

	public java.lang.String getCityName() {
		return cityName;
	}

	public void setCityName(java.lang.String cityName) {
		this.cityName = cityName;
	}
	
	public String[] getTagNameList() {
		if(StringUtil.isBlank(this.getTagName())){
			return new String[0];
		}else{
			return this.getTagName().split(",");
		}
	}
	
	public boolean getIsShowCategory(){
		if(this.getCategoryId() == null){
			return false;
		}else{
			return true;
		}
	}
	
	public boolean getIsShowMemberCount(){
		if(this.getMemberCount() == null){
			return false;
		}
		if(this.getMemberCount()>0){
			return true;
		}else{
			return false;
		}
	}

	public java.lang.String getZoneLevelName() {
		return zoneLevelName;
	}

	public void setZoneLevelName(java.lang.String zoneLevelName) {
		this.zoneLevelName = zoneLevelName;
	}

	public java.lang.Integer getOidx() {
		return oidx;
	}

	public void setOidx(java.lang.Integer oidx) {
		this.oidx = oidx;
	}

	public java.lang.String getExtCommunityNames() {
		return extCommunityNames;
	}

	public void setExtCommunityNames(java.lang.String extCommunityNames) {
		this.extCommunityNames = extCommunityNames;
	}
}